home *** CD-ROM | disk | FTP | other *** search
/ PD Collection CD 1 / PD Collection CD 1.iso / textual / tex / files / !tex / latexsty3 / TUGBOT / sty
Encoding:
Text File  |  1990-01-16  |  44.0 KB  |  1,121 lines

  1. %                       *****     TUGBOT86.STY    *****        11 Jan 88, bb
  2. %
  3. %       WARNING -- UNDER CONSTRUCTION
  4. %
  5. %       This file contains the TeX82 instructions for preparing a document
  6. %       in TUGboat format.  It is based on the TeX80 TUGboat format and on
  7. %       AMSPPT.STY (AMS-TeX82).  It is compatible with, but does not
  8. %       require (or load) AMS-TeX.  It assumes that PLAIN.TEX is preloaded.
  9. %
  10. %       This version differs in significant ways from the production version
  11. %       used at the AMS to generate the published TUGboat; particular
  12. %       features of the production version address idiosyncracies of the
  13. %       Alphatype CRS typesetter, used to prepare camera copy, which are not
  14. %       relevant to output prepared on, e.g., a laser printer.
  15. %
  16. %       Explicit registers:
  17. %               Counters:       0 = \pageno (PLAIN)
  18. %                               1 = \xcol -- column on page (values 1 or 2)
  19. %                               2 = \spoolno -- sequential segment count
  20. %               Files:          1 = page number xref definitions
  21.  
  22.  
  23. \def\makeatletter{\catcode`\@=11 }
  24. \chardef\other=12
  25. \def\makeatother{\catcode`\@=\other}
  26.  
  27. \makeatletter        % used, as in PLAIN, in protected control sequences
  28.  
  29. %      Stuff different from PLAIN, or reiterated for clarity
  30.  
  31. \def~{\penalty\@M \ } % tie -- this is PLAIN value; it is reset in AMS-TeX
  32.  
  33. \clubpenalty=10000
  34. \widowpenalty=10000
  35.  
  36. \normallineskiplimit=1pt
  37.  
  38. \newif\ifNoParIndent            \NoParIndentfalse
  39. \def \NoParIndent{\parindent=0pt \NoParIndenttrue}
  40.  
  41. \newdimen\normalparindent        \normalparindent=20pt          % plain = 20pt
  42. \def \NormalParIndent{\global\parindent=\normalparindent
  43.         \global\NoParIndentfalse}
  44. \NormalParIndent
  45.  
  46. %               set up auxiliary `page numbers'
  47. %               \pageno = \count0  as used in PLAIN
  48. \countdef\xcol=1        \xcol=1
  49. \countdef\spoolno=2     \spoolno=1
  50.  
  51. %       some things with the same names as in, or reiterated from, AMS-TeX
  52.  
  53. \def \BlackBoxes{\overfullrule=5pt }
  54. \def \NoBlackBoxes{\overfullrule=0pt }
  55. \def \document{}                % override an AMS-TeX convention
  56. \def \linebreak{\unskip\break}
  57. \def \newline{\hskip0pt plus\pagewd \break}
  58. %\let\brk=\linebreak            % TeX80 version
  59. %\let\lbrk=\newline             % TeX80 version
  60. \output{\output@}
  61.  
  62. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  63. %                                                                             %
  64. %               *****     utility registers and definitions     *****         %
  65. %                                                                             %
  66. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  67.  
  68.  
  69. %       test registers for transient use; paired - internal/external
  70. \newbox\T@stBox                 \newbox\TestBox
  71. \newcount\T@stCount             \newcount\TestCount
  72. \newdimen\T@stDimen             \newdimen\TestDimen
  73. \newif\ifT@stIf         \newif\ifTestIf
  74.  
  75.  
  76. %       \cs existence test, stolen from TeXbook exercise 7.7
  77. \def \ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax }
  78.  
  79.  
  80. %       Smashes repeated from AMS-TeX; PLAIN implements only full \smash .
  81. \newif\iftop@           \newif\ifbot@
  82. \def\topsmash{\top@true\bot@false\smash@}
  83. \def\botsmash{\top@false\bot@true\smash@}
  84. \def\smash{\top@true\bot@true\smash@}
  85. \def\smash@{\relax\ifmmode\def\next{\mathpalette\mathsm@sh}%
  86.         \else\let\next\makesm@sh\fi \next }
  87. \def\finsm@sh{\iftop@\ht\z@\z@\fi\ifbot@\dp\z@\z@\fi\box\z@}
  88.  
  89.  
  90. %    Vertical `laps'; cf. \llap and \rlap
  91. \long\def\ulap#1{\vbox to \z@{\vss#1}}
  92. \long\def\dlap#1{\vbox to \z@{#1\vss}}
  93.  
  94. %    And centered horizontal and vertical `laps'
  95. \def\xlap#1{\hbox to \z@{\hss#1\hss}}
  96. \long\def\ylap#1{\vbox to \z@{\vss#1\vss}}
  97. \long\def\zlap#1{\ylap{\xlap{#1}}}
  98.  
  99.  
  100. %       Avoid unwanted vertical glue when making up pages.
  101. \def \basezero{\baselineskip\z@ \lineskip\z@}
  102.  
  103.  
  104. %    Today's date, to be printed on drafts.  Based on TeXbook, p.406.
  105.  
  106. \def\today{\number\day\space \ifcase\month\or
  107.     Jan \or Feb \or Mar \or Apr \or May \or Jun \or
  108.     Jul \or Aug \or Sep \or Oct \or Nov \or Dec \fi
  109.     \number\year}
  110.  
  111. \newif\ifPrelimDraft        \PrelimDraftfalse
  112. \def\PrelimDraft{\PrelimDrafttrue
  113.     \def\midrtitle{\tensl preliminary draft, \today}}
  114.  
  115.  
  116. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  117. %                                                                             %
  118. %                       ***** fonts and friends *****                         %
  119. %                                                                             %
  120. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  121.  
  122.  
  123. %       Struts give ascenders and descenders to assist in baseline alignment
  124. %       (e.g. of adjoining vertical boxes); useful only with text fonts.
  125. %
  126. %       \strut is defined in PLAIN .  The structure of \strutt is equivalent.
  127.  
  128. \newbox\struttbox
  129. \def\strutt{\relax\ifmmode\copy\struttbox\else\unhcopy\struttbox\fi}
  130.  
  131. %       Struts are given the following dimensions for use in TUGboat:
  132. %
  133. %               \strut = height/depth of parenthesis in current font
  134. %                        (not the same as PLAIN)
  135. %               \strutt height + depth = \normalbaselineskip,
  136. %                        height = same as \strut
  137. %                        (equivalent to PLAIN \strut )
  138.  
  139.  
  140. %       The fonts below are sufficient for most ordinary TUGboat production.
  141. %       Additional titling fonts are defined elsewhere, and occasionally an
  142. %       extra font will be needed for a particular item (e.g. the device
  143. %       charts) and defined in that file.
  144.  
  145. %               all PLAIN CM fonts
  146.  
  147. \font\tenrm=cmr10
  148. \font\ninerm=cmr9
  149. \font\eightrm=cmr8
  150. \font\sevenrm=cmr7
  151. \font\sixrm=cmr6
  152. \font\fiverm=cmr5
  153.  
  154. \font\teni=cmmi10 \skewchar\teni='177
  155. \font\ninei=cmmi9 \skewchar\ninei='177
  156. \font\eighti=cmmi8 \skewchar\eighti='177
  157. \font\seveni=cmmi7 \skewchar\seveni='177
  158. \font\sixi=cmmi6 \skewchar\sixi='177
  159. \font\fivei=cmmi5 \skewchar\fivei='177
  160.  
  161. \font\tensy=cmsy10 \skewchar\tensy='60
  162. \font\ninesy=cmsy9 \skewchar\ninesy='60
  163. \font\eightsy=cmsy8 \skewchar\eightsy='60
  164. \font\sevensy=cmsy7 \skewchar\sevensy='60
  165. \font\sixsy=cmsy6 \skewchar\sixsy='60
  166. \font\fivesy=cmsy5 \skewchar\fivesy='60
  167.  
  168. \font\tenex=cmex10
  169.  
  170. \font\tenbf=cmbx10
  171. \font\ninebf=cmbx9
  172. \font\eightbf=cmbx8
  173. \font\sevenbf=cmbx7
  174. \font\sixbf=cmbx6
  175. \font\fivebf=cmbx5
  176.  
  177. \font\tentt=cmtt10
  178. \font\ninett=cmtt9
  179. \font\eighttt=cmtt8
  180.  
  181. \font\tensl=cmsl10
  182. \font\ninesl=cmsl9
  183. \font\eightsl=cmsl8
  184. %\font\sevensl=amsl7
  185. \let\sevensl=\eightsl                % for distribution
  186.  
  187. \font\tenit=cmti10
  188. \font\nineit=cmti9
  189. \font\eightit=cmti8
  190. \font\sevenit=cmti7
  191.  
  192. \font\tenupit=cmu10
  193.  
  194. \font\tensmc=cmcsc10
  195.  
  196.  
  197. \font\tentex=cmtex10
  198.  
  199. \def \mit{\fam\@ne}
  200. \def \cal{\fam\tw@}
  201. \def \sy{\cal}          % old name
  202.  
  203. %               fonts added at AMS
  204.  
  205. % \font\eightex=amex8
  206.  
  207. % \newfam\cyrfam        % uncomment if needed
  208.  
  209. % \font\tencyr=mcyr10
  210. % \font\ninemcyr=mcyr9
  211. % \font\eightcyr=mcyr8
  212. % \font\sixcyr=mcyr6
  213.  
  214. %\font\ninesmc=amcsc9
  215. \let\ninesmc=\tensmc                    % temporary expedient
  216. %\font\eightsmc=amcsc8
  217. \let\eightsmc=\tensmc                   % temporary expedient
  218.  
  219. %    Approximations, until ``actual-size'' fonts available
  220. \font \sixteenssb=cmssbx10 scaled \magstep3
  221. \font \twelvessb=cmssbx10 scaled \magstep1
  222. \font \tenssb=cmssbx10
  223. %\font \eightssb=amssbx8
  224.  
  225. %\font \seventphon=tphon7               % used in macro index and device list
  226.  
  227. \newfam\titlefam
  228. \def \titlefont{\textfont\titlefam=\sixteenssb
  229.     \scriptfont\titlefam=\twelvessb \scriptscriptfont\titlefam=\tenssb
  230.     \fam\titlefam \sixteenssb \baselineskip=16pt }
  231. %           Formerly \twelvessb and \eightssb
  232.  
  233.  
  234. %       Planned additions and changes:
  235. %
  236. %       Dynamic loading of fonts, probably in groups according to size
  237. %       Removal of \rm, \bf, etc., from \*point expansions, replacement
  238. %               by generic \rm, \bf, etc. definitions
  239. %       Mechanism for switching neatly between serif and sans-serif
  240.  
  241.  
  242. %       Allow text to be a bit stretchier than the built-in setting;
  243. %       TeXbook, page 433, 355
  244.  
  245. \newdimen\normaltenptstretch    \normaltenptstretch=1.6667pt
  246. \newdimen\extratenptstretch     \extratenptstretch=4pt
  247. \def\NormalTenPointSpacing{\fontdimen3\tenrm=\normaltenptstretch
  248.                 \fontdimen3\tenit=\normaltenptstretch}
  249. \def\StretchyTenPointSpacing{\fontdimen3\tenrm=\extratenptstretch
  250.                 \fontdimen3\tenit=\extratenptstretch}
  251.  
  252. \def \AddToTenPoint{}           % permit external additions to font
  253.  
  254. \def \tenpoint{\normalbaselineskip=12pt         % \def\pointsize@AmS{t}
  255.         \abovedisplayskip=3pt plus 3pt minus 1pt
  256.         \belowdisplayskip=3pt plus 3pt minus 1pt
  257.         \abovedisplayshortskip=0pt plus 3pt
  258.         \belowdisplayshortskip=1pt plus 3pt minus 1pt
  259.         \def\rm{\fam\z@\tenrm}%
  260.         \textfont0=\tenrm \scriptfont0=\sevenrm \scriptscriptfont0=\fiverm
  261.         \def\oldstyle{\fam\@ne\teni}%
  262.         \textfont1=\teni \scriptfont1=\seveni \scriptscriptfont1=\fivei
  263.         \textfont2=\tensy \scriptfont2=\sevensy \scriptscriptfont2=\fivesy
  264.         \textfont3=\tenex \scriptfont3=\tenex \scriptscriptfont3=\tenex
  265.         \def\it{\fam\itfam\tenit}%
  266.         \textfont\itfam=\tenit \scriptfont\itfam=\sevenit
  267.         \def\sl{\fam\slfam\tensl}%
  268.         \textfont\slfam=\tensl \scriptfont\slfam=\sevensl
  269.         \def\bf{\fam\bffam\tenbf}%
  270.         \textfont\bffam=\tenbf \scriptfont\bffam=\eightbf
  271.                 \scriptscriptfont\bffam=\sixbf
  272. %       \def\cyr{\fam\cyrfam\tencyr}%
  273. %       \textfont\cyrfam=\tencyr \scriptfont\cyrfam=\eightcyr
  274. %               \scriptscriptfont\cyrfam=\sixcyr
  275.         \def\smc{\tensmc}%
  276.         \def\tt{\tentt}%
  277.         \def\upright{\tenupit}%
  278.         \setbox\strutbox=\hbox{\vrule height7.5pt depth2.5pt width\z@}%
  279.         \setbox\struttbox=\hbox{\vrule height8.5pt depth3.5pt width\z@}%
  280.         \normalbaselines \AddToTenPoint \rm }
  281.  
  282. \tenpoint                       % initialize -- default font
  283.  
  284.  
  285. \newdimen\normalnineptstretch   \normalnineptstretch=1.5pt
  286. \newdimen\extranineptstretch    \extranineptstretch=3.6pt
  287. \def\NormalNinePointSpacing{\fontdimen3\ninerm=\normalnineptstretch}
  288. \def\StretchyNinePointSpacing{\fontdimen3\ninerm=\extranineptstretch}
  289.  
  290. \def \AddToNinePoint{}
  291.  
  292. \def \ninepoint{\normalbaselineskip=11pt
  293.         \abovedisplayskip=2.5pt plus 2.5pt minus 1pt
  294.         \belowdisplayskip=2.5pt plus 2.5pt minus 1pt
  295.         \abovedisplayshortskip=0pt plus 2.5pt
  296.         \belowdisplayshortskip=1pt plus 2.5pt minus 1pt
  297.         \def\rm{\fam\z@\ninerm}%
  298.         \textfont0=\ninerm \scriptfont0=\sevenrm \scriptscriptfont0=\fiverm
  299.         \def\oldstyle{\fam\@ne\ninei}%
  300.         \textfont1=\ninei \scriptfont1=\seveni \scriptscriptfont1=\fivei
  301.         \textfont2=\ninesy \scriptfont2=\sevensy \scriptscriptfont2=\fivesy
  302.         \def\it{\fam\itfam\nineit}%
  303.         \textfont\itfam=\nineit
  304.         \def\sl{\fam\slfam\ninesl}%
  305.         \textfont\slfam=\ninesl
  306.         \def\bf{\fam\bffam\ninebf}%
  307.         \textfont\bffam=\ninebf \scriptfont\bffam=\sevenbf
  308.                 \scriptscriptfont\bffam=\sixbf
  309. %       \def\cyr{\fam\cyrfam\ninmcyr}%
  310. %       \textfont\cyrfam=\ninmcyr \scriptfont\cyrfam=\sixcyr
  311. %               \scriptscriptfont\cyrfam=\sixcyr
  312.         \def\smc{\ninesmc}%
  313.         \def\tt{\ninett}%
  314.         \setbox\strutbox=\hbox{\vrule height 6.75pt depth 2.25pt width\z@}%
  315.        \setbox\struttbox=\hbox{\vrule height 7.75pt depth 3.25pt width\z@}%
  316.         \normalbaselines \AddToNinePoint \rm }
  317.  
  318. %               this is equivalent to baselineskip = 10pt
  319. %        \setbox\struttbox=\hbox{\vrule height 7.25pt depth 2.75pt width\z@}%
  320.  
  321.  
  322. \newdimen\normaleightptstretch  \normaleightptstretch=1.333pt
  323. \newdimen\extraeightptstretch   \extraeightptstretch=3pt
  324. \def\NormalEightPointSpacing{\fontdimen3\eightrm=\normaleightptstretch}
  325. \def\StretchyEightPointSpacing{\fontdimen3\eightrm=\extraeightptstretch}
  326.  
  327. \def \AddToEightPoint{}
  328.  
  329. \def \eightpoint{\normalbaselineskip=10pt
  330.         \abovedisplayskip=2pt plus 2pt minus 1pt
  331.         \belowdisplayskip=2pt plus 2pt minus 1pt
  332.         \abovedisplayshortskip=0pt plus 2pt
  333.         \belowdisplayshortskip=1pt plus 2pt minus 1pt
  334.         \def\rm{\fam\z@\eightrm}%
  335.         \textfont0=\eightrm \scriptfont0=\sixrm \scriptscriptfont0=\fiverm
  336.         \def\oldstyle{\fam\@ne\eighti}%
  337.         \textfont1=\eighti \scriptfont1=\sixi \scriptscriptfont1=\fivei
  338.         \textfont2=\eightsy \scriptfont2=\sixsy \scriptscriptfont2=\fivesy
  339. %       \textfont3=\eightex \scriptfont3=\eightex \scriptscriptfont3=\eightex
  340.         \def\it{\fam\itfam\eightit}%
  341.         \textfont\itfam=\eightit
  342.         \def\sl{\fam\slfam\eightsl}%
  343.         \textfont\slfam=\eightsl
  344.         \def\bf{\fam\bffam\eightbf}%
  345.         \textfont\bffam=\eightbf \scriptfont\bffam=\sixbf
  346.                 \scriptscriptfont\bffam=\sixbf
  347. %       \def\cyr{\fam\cyrfam\eightcyr}%
  348. %       \textfont\cyrfam=\eightcyr \scriptfont\cyrfam=\sixcyr
  349. %               \scriptscriptfont\cyrfam=\sixcyr
  350.         \def\smc{\eightsmc}%
  351.         \def\tt{\eighttt}%
  352.         \setbox\strutbox=\hbox{\vrule height 6pt depth 2pt width\z@}%
  353.         \setbox\struttbox=\hbox{\vrule height 7pt depth 3pt width\z@}%
  354.         \normalbaselines \AddToEightPoint \rm }
  355.  
  356. %               this is equivalent to baselineskip = 9pt
  357. %       \setbox\struttbox=\hbox{\vrule height 6.5pt depth 2.5pt width\z@}%
  358.  
  359. %       PLAIN's definition of \raggedright doesn't permit any stretch, and
  360. %       results in too many overfull boxes.  Change.
  361. \newdimen\raggedskip            \raggedskip=\z@
  362. \newdimen\raggedstretch         \raggedstretch=5em
  363. \newskip\raggedparfill          \raggedparfill=\z@ plus 1fil
  364.  
  365. \def \raggedspaces{\spaceskip=.3333em \xspaceskip=.5em }
  366. %       Some applications may have to add stretch, in order to avoid
  367. %       all overfull boxes.
  368.  
  369. \def \raggedright{\rightskip=\raggedskip plus\raggedstretch \raggedspaces
  370.                 \parfillskip=\raggedparfill }
  371. \def \raggedleft{\leftskip=\raggedskip plus\raggedstretch \raggedspaces
  372.                 \parfillskip=\z@ }
  373. \def \raggedcenter{\leftskip=\raggedskip plus\raggedstretch
  374.                 \rightskip=\leftskip \raggedspaces
  375.                 \parindent=\z@ \parfillskip=\z@ }
  376.  
  377. \def \normalspaces{\spaceskip=.3333em plus.1667em minus.1111em
  378.                 \xspaceskip=.4444em plus.5em minus.037em }
  379.  
  380. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  381. %                                                                             %
  382. %                       *****   abbreviations   *****                         %
  383. %                                                                             %
  384. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  385.  
  386.  
  387. \def \careof{\leavevmode\hbox{\raise.75ex\hbox{c}\kern-.15em
  388.                 /\kern-.125em\smash{\lower.3ex\hbox{o}}} \ignorespaces}
  389. \def \sfrac#1/#2{\leavevmode\kern.1em
  390.         \raise.5ex\hbox{\the\scriptfont0 #1}\kern-.1em
  391.         /\kern-.15em\lower.25ex\hbox{\the\scriptfont0 #2}}
  392.  
  393. \def \d@sh#1{\nobreak\thinspace#1\penalty0\thinspace}
  394. \def \dash{\d@sh{--}}
  395. \def \Dash{\d@sh{---}}
  396.  
  397. %    Hack to permit automatic hyphenation after an actual hyphen.
  398.  
  399. \def\hyph{-\penalty0\hskip0pt\relax }
  400.  
  401. \def\slash{/\penalty0\hskip0pt}     % "breakable" slash
  402.  
  403. \def \TeX{\leavevmode\hbox{T\kern-.1667em\lower.424ex\hbox{E}\kern-.125emX}}
  404. \def \TUG{\TeX\ \UG}
  405. \def \UG{Users Group}
  406. \def \TUB{TUGboat}
  407. \def \SC{Steering Committee}
  408. \def \AMS{American Mathematical Society}
  409. \def \POBox{P.\thinspace O.~Box }
  410. \def \POBoxTUG{\POBox\unskip~9506, Providence, RI~02940}
  411. \def \AMSTeX{\leavevmode\hbox{$\cal A\kern-.2em\lower.376ex
  412.         \hbox{$\cal M$}\kern-.2em\cal S$-\TeX}}
  413. \def \JoT{{\sl The Joy of \TeX}}
  414. %       note -- \LaTeX definition is from LATEX.TEX 2.09 of 7 Jan 86,
  415. %               adapted for additional flexibility in TUGboat
  416. %\def\LaTeX{{\rm L\kern-.36em\raise.3ex\hbox{\sc a}\kern-.15em
  417. %    T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
  418. \def \LaTeX{\TestCount=\the\fam \leavevmode L\raise.42ex
  419.     \hbox{$\fam\TestCount\scriptstyle\kern-.3em A$}\kern-.15em\TeX}
  420. %       Note -- The `official' \MF uses \font\manual=manfnt, which,
  421. %               although it is now in general distribution, may not be
  422. %               available to all users.
  423. \let\manual=\tenssb       % replace by manfnt if that is available
  424. %\font\manual=manfnt % font used for the METAFONT logo, etc.
  425. \def \MF{{\manual META}\-{\manual FONT}}
  426. \let\slMF=\MF
  427. %\def \slMF{{\manual 89:;}\-{\manual <=>:}} % slant the logo
  428. \def \mf{{\smc Metafont}}
  429. \def \Pas{Pascal}
  430. \def \UNIX{{\smc unix}}
  431. \def \VAX{\leavevmode\hbox{V\kern-.12em A\kern-.1em X}}
  432. \def \WEB{{\tt WEB}}
  433.  
  434. %    Miscellaneous useful stuff
  435.  
  436. \def\bull{\vrule height 1ex width .8ex depth -.2ex } % square bullet
  437. \def\cents{{\rm\raise.2ex\rlap{\kern.05em$\scriptstyle/$}c}}
  438.  
  439. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  440. %                                                                             %
  441. %                       *****  page dimensions  *****                         %
  442. %                                                                             %
  443. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  444.  
  445.  
  446. \newdimen\trimlgt       \trimlgt=10.5in     % 11in
  447. \newdimen\headmargin    \headmargin=2.5pc    % 3.5pc
  448. \newdimen\pagelgt
  449. \newdimen\rheadlgt      \rheadlgt=2.5pc         %% + headmargin = 6pc = 1in
  450. \newdimen\toplgt        \toplgt=0pt
  451. \newdimen\normalcollgt  \normalcollgt=54pc      % 52pc for 5#2
  452. \newdimen\collgt        \collgt=\normalcollgt
  453. \newdimen\Collgt
  454. \maxdepth=2pt
  455. \newdimen\botlgt        \botlgt=0pt
  456. \newdimen\rfootlgt      \rfootlgt=2pc
  457.  
  458. \newif\ifThisIsFirstPage        \ThisIsFirstPagefalse
  459.  
  460. \def \resetpagelgt{\pagelgt=\collgt \Collgt=\collgt
  461.         \advance\pagelgt by \rheadlgt
  462.         \ifThisIsFirstPage \advance\Collgt by-\toplgt
  463.                         \advance\Collgt by-\botlgt \fi
  464.         \advance\pagelgt by \maxdepth
  465.         \global\advance\pagelgt by \rfootlgt
  466.         \global\vsize=\Collgt }
  467. \def \resetfpagelgt{\global\ThisIsFirstPagetrue
  468.         \resetpagelgt }                 % exclude special first page material
  469.  
  470. \resetpagelgt
  471. \raggedbottom
  472.  
  473. \newdimen\colwd
  474. \newdimen\pagewd        \pagewd=39pc
  475. \newdimen\trimwd        \trimwd=\pagewd
  476.  
  477. \def \onecol{\colwd=\pagewd             \OneCol }
  478.  
  479. \newdimen\onenarrowcolwd        \onenarrowcolwd=30pc
  480. \def \onenarrow{\colwd=\onenarrowcolwd  \OneCol }
  481.  
  482. %       before 5#2, `narrow' was 34pc
  483. \newdimen\onemediumcolwd        \onemediumcolwd=34pc
  484. \def \onemedium{\colwd=\onemediumcolwd  \OneCol }
  485.  
  486. \newdimen\twocolcolwd           \twocolcolwd=18.75pc
  487. \def \twocol{\colwd=\twocolcolwd        \TwoCol }
  488.  
  489. \newdimen\threecolcolwd         \threecolcolwd=12pc
  490. \def \threecol{\colwd=\threecolcolwd    \ThreeCol }
  491.  
  492.  
  493. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  494. %                                                                             %
  495. %                       *****      headers/footers      *****                 %
  496. %                                                                             %
  497. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  498.  
  499.  
  500. \def \midrtitle{}               % to allow for ``advertisements'' notice
  501.  
  502. \def \rtitlex{\TUB, \volx }
  503. \def \rtitle{\hbox to \pagewd{\tenrm
  504.         \rlap{\hbox to \pagewd{\hfil\midrtitle\hfil}}%
  505.         \ifodd\pageno \rtitlex\hfil\number\pageno
  506.         \else \number\pageno\hfil\rtitlex \fi }}
  507.  
  508. \def \runhead{\vbox to \rheadlgt{\topskip=1pc \rtitle \vfil }}
  509. \def \runfoot{\vbox to \rfootlgt{\topskip=1.5pc
  510.         \ifnum\xcol=2 \hbox to \pagewd{\midrtitle\hfil\midrtitle}\fi
  511.         \vfil }}
  512.  
  513. \def \resetfirsthead{\global\toplgt=\z@ \gdef\firsthead{}}
  514. \resetfirsthead
  515. \newbox\firsth@@d       \newbox\firsth@ad
  516. \def \setfirsthead{\global\ThisIsFirstPagetrue
  517.     \def\endset{\egroup        % finish \T@stBox
  518.             \ifdim \toplgt=\z@ \global\toplgt=\ht\T@stBox \resetpagelgt \fi
  519. %                       assume that \firsth@ad ends with glue, hence no \dp
  520.                 \global\setbox\firsth@ad=\vbox to \toplgt{\box\T@stBox \vfil}%
  521.             \global\setbox\firsth@@d=\vbox to \toplgt{\vfil}%
  522.             \gdef\firsthead{\ifnum \xcol=2 \box\firsth@ad
  523.                             \else \copy\firsth@@d \fi }}%
  524.     \setbox\T@stBox=\vbox\bgroup \hsize=\pagewd }
  525.  
  526.  
  527. \def \resetfirstfoot{\global\botlgt=\z@ \gdef\firstfoot{}}
  528. \resetfirstfoot
  529. \newbox\firstf@@t       \newbox\firstf@ot
  530. \def \setfirstfoot{\global\ThisIsFirstPagetrue
  531.     \def\endset{\egroup        % finish \T@stBox
  532.             \ifdim \botlgt=\z@ \botlgt=\ht\T@stBox
  533.             \global\advance\botlgt by \dp\T@stBox \resetpagelgt
  534.         \fi
  535.                 \global\setbox\firstf@ot=\vbox to \botlgt{\box\T@stBox \vfil}%
  536.             \global\setbox\firstf@@t=\vbox to \botlgt{\vfil}%
  537.             \gdef\firstfoot{\ifnum \xcol=2 \copy\firstf@ot
  538.                             \else \copy\firstf@@t \fi }}%
  539.     \setbox\T@stBox=\vbox\bgroup \hsize=\pagewd }
  540.  
  541.  
  542. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  543. %                                                                             %
  544. %                       *****       output      *****                         %
  545. %                                                                             %
  546. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  547.  
  548.  
  549. %       In the absence of automatic column-balancing, provide a mechanism
  550. %       for manually shortening a specified page.
  551.  
  552. \newif\ifSh@rtPage              \Sh@rtPagefalse
  553. \newif\ifSh@rtPagePending       \Sh@rtPagePendingfalse
  554. \newcount\Sh@rtPageNo
  555. \newdimen\Sh@rtPageLgt
  556.  
  557. \def\@to{to}                    \def\@by{by}
  558. %       #1 = to/by; #2 = \dimen; #3 = <dimen>; #4 = * of Shorten*Page
  559. \def\@toby#1#2#3#4{\def\@tb{#1}%
  560.         \ifx \@tb\@to \global #2=#3
  561.         \else \ifx \@tb\@by \T@stDimen=#3         % accommodate negative #3
  562.                         #2=\normalcollgt \global\advance #2 by -#3
  563.                 \else \errmessage{#1 is invalid syntax; \string\Shorten#4Page
  564.                                 requires "to" or "by"}\fi
  565.         \fi }
  566.  
  567. \def\@plusno#1#2;{\if +#1\T@stCount=\pageno \advance\T@stCount by #2
  568.                         \else \T@stCount=#1#2 \fi }
  569.  
  570. \def \ShortenPage #1 #2 #3. {\global\Sh@rtPagePendingtrue
  571. %               \global\Sh@rtPageNo=#1
  572.                 \@plusno#1;\global\Sh@rtPageNo=\T@stCount
  573.                 \@toby{#2}{\Sh@rtPageLgt}{#3}{}}
  574. \def \ShortenThisPage #1 #2. {\global\Sh@rtPagetrue
  575.                 \@toby{#1}{\vsize}{#2}{This}}
  576.  
  577. %       Two cases: 0 = last page was nonstandard; reset \vsize
  578. %                  1 = do not reset \vsize: okay or length already reset
  579. \def \D@EndPage{\global\advancepageno
  580.         \T@stCount=1
  581.         \ifThisIsFirstPage \T@stCount=0 \global\ThisIsFirstPagefalse
  582.                         \resetfirsthead \resetfirstfoot
  583.                         \global\collgt=\normalcollgt \fi
  584.         \ifSh@rtPage \T@stCount=0 \global\Sh@rtPagefalse \fi
  585.         \ifSh@rtPagePending
  586.                 \ifnum\pageno = \Sh@rtPageNo \T@stCount=1
  587.                         \global\vsize=\Sh@rtPageLgt
  588.                         \global\Sh@rtPagePendingfalse
  589.                         \global\Sh@rtPagetrue \fi
  590.         \fi
  591.         \ifcase \T@stCount \resetpagelgt \fi }
  592.  
  593.  
  594. %       Distinguish between laser printer output (for proofing and other
  595. %       general use) and production, which uses a phototypesetter.
  596.  
  597. \newif\ifLaser                  \Lasertrue
  598.  
  599.  
  600. %       Registration marks
  601.  
  602. \def \HorzR@gisterRule{\vrule height 0.2pt depth 0pt width 0.5in }
  603. \def \DownShortR@gisterRule{\vrule height 0.2pt depth 1pc width 0.2pt }
  604. \def \UpShortR@gisterRule{\vrule height 1pc depth 0pt width 0.2pt }
  605.  
  606.  
  607. %               ``T'' marks centered on top and bottom edges of paper
  608.  
  609. \def \ttopregister{\dlap{%
  610.         \hbox to \trimwd{\HorzR@gisterRule \hfil \HorzR@gisterRule
  611.                         \HorzR@gisterRule \hfil \HorzR@gisterRule}%
  612.         \hbox to \trimwd{\hfil \DownShortR@gisterRule \hfil}}}
  613. \def \tbotregister{\ulap{%
  614.         \hbox to \trimwd{\hfil \UpShortR@gisterRule \hfil}%
  615.         \hbox to \trimwd{\HorzR@gisterRule \hfil \HorzR@gisterRule
  616.                         \HorzR@gisterRule \hfil \HorzR@gisterRule}}}
  617.  
  618. \def \topregister{\ttopregister}
  619. \def \botregister{\tbotregister}
  620.  
  621.  
  622. %       All pages containing data are formatted by \midpage
  623.  
  624. \def \midpage#1{\vbox{\basezero
  625.         \ifLaser \hrule height\z@ depth\z@ width\p@
  626.                 \vskip-\rheadlgt
  627.         \else \vbox to \trimlgt \bgroup
  628.                 \topregister
  629.                 \vskip \headmargin
  630.         \fi
  631.         \vbox to \pagelgt{\basezero
  632.                 \ifnum\xcol=2 \runhead
  633.                 \else \vbox to \rheadlgt{}\fi
  634.                 \ifThisIsFirstPage \firsthead \fi
  635.                 \hbox to \pagewd{#1}%   % \vsize applied in \pagebody
  636.                 \ifThisIsFirstPage \firstfoot \fi
  637.                 \vfil           % if no depth, avoid underfull box
  638.                 \runfoot }%
  639.         \ifLaser \else \vfill \botregister \egroup \fi}%
  640.         \ifnum\xcol=2 \global\xcol=1 \D@EndPage
  641.         \else \global\xcol=2 \fi
  642.         \global\advance\spoolno by 1 }
  643.  
  644. %       The production version includes trim marks, which are required
  645. %       on photographic paper, but are unsuitable for laser printer output.
  646. %       The production version also generates 2 separate .dvi pages for each
  647. %       logical page; these are overlaid photographically, and allow the
  648. %       Alphatype to run more efficiently on 2-column pages.
  649. %       For laser printer output, each page is output as a unit.
  650.  
  651.  
  652. %       Reorganize \pagecontents from PLAIN to put footnotes at very
  653. %       bottom of page, even if \raggedbottom.
  654.  
  655. \def\pagecontents{\ifvoid\topins\else\unvbox\topins\fi
  656.   \dimen@=\dp\@cclv \unvbox\@cclv % open up \box255
  657.   \ifr@ggedbottom \kern-\dimen@ \vfil \fi
  658.   \ifvoid\footins\else % footnote info is present
  659.     \vskip\skip\footins
  660.     \footnoterule
  661.     \unvbox\footins\fi }
  662.  
  663.  
  664. \def \newcol{\par\vfill\eject}
  665.  
  666. \newif\ifOneColFormat
  667. \newbox\SaveP@geBox
  668.  
  669. \def \OneCol{\hsize=\colwd
  670.         \gdef\newpage{\par\vfill\eject}%
  671.         \OneColFormattrue
  672.         \gdef\output@{%
  673.                 \ifLaser \xcol=2 \shipout\midpage{\hfil\pagebody \hfil}%
  674.                 \else \shipout\midpage{\hfil\pagebody \hfil}%
  675.                         \shipout\vbox to \trimlgt{\basezero
  676.                                 \topregister
  677.                                 \vskip\headmargin
  678.                                 \vbox to \pagelgt{\basezero
  679.                                         \runhead
  680.                                         \vfill }%
  681.                                 \vfill
  682.                                 \botregister }%
  683.                         \D@EndPage
  684.                         \global\xcol=1
  685.             \global\advance\spoolno by 1
  686.                 \fi }}
  687.  
  688. \def \TwoCol{\hsize=\colwd
  689.         \gdef\newpage{\par\vfill\eject
  690.                         \ifnum\xcol=2 \null\vfill\eject \fi }%
  691.         \OneColFormatfalse
  692.         \gdef\output@{% % use PLAIN's \pagebody instead of \box255
  693.                 \ifnum\xcol=1
  694.                         \ifLaser \global\setbox\SaveP@geBox=\vbox{\pagebody}%
  695.                                 \global\xcol=2
  696.                         \else \shipout\midpage{\pagebody \hfil}\fi
  697.                 \else \shipout\midpage{\ifLaser \box\SaveP@geBox \fi
  698.                                 \hfil\pagebody }\fi
  699.                 \ifnum\outputpenalty>-\@MM \else \dosupereject \fi }}
  700.  
  701.  
  702. %    Three-column format is a hack.  Collect all column data and
  703. %    ship it out in the third segment, but conform to the \midpage
  704. %    convention that \xcol can never be greater than 2.
  705.  
  706. \newbox\SaveP@geTwoBox
  707.  
  708. \def \ThreeCol{\hsize=\colwd
  709.         \gdef\newpage{\par\vfill\eject
  710.         \loop \ifnum\xcol>1 \advance\xcol by 1
  711.                         \hbox to \hsize{\hfill}\vfill\eject \repeat }%
  712.         \OneColFormatfalse
  713.         \gdef\output@{% % use PLAIN's \pagebody instead of \box255
  714.                 \ifnum\xcol=1
  715.                         \global\setbox\SaveP@geBox=\vbox{\pagebody}%
  716.                                 \global\xcol=2
  717.                 \else \ifnum\xcol=2
  718.                         \global\setbox\SaveP@geTwoBox=\vbox{\pagebody}%
  719.                                 \global\xcol=3
  720.             \else \ifLaser
  721.                 \else \xcol=1 \shipout\midpage
  722.                     {\vbox to \vsize{\null\vfill}}\fi
  723.                 \xcol=2
  724.                 \shipout\midpage{\box\SaveP@geBox
  725.                                     \hfil \box\SaveP@geTwoBox
  726.                     \hfil \pagebody }\fi
  727.         \fi
  728.                 \ifnum\outputpenalty>-\@MM \else \dosupereject \fi }}
  729.  
  730.  
  731. %       Dates and other items which identify the volume and issue
  732.  
  733. %       To use: \vol 5, 2.
  734. %               \issdate October 1984.
  735. %               \issueseqno=10
  736. %       For production, these are set in a separate file, TUGBOT.DATES,
  737. %       which is issue-specific.
  738.  
  739. \def \v@lx{\gdef\volx{Volume~\volno~(\volyr), No.~\issno}}
  740. \def \volyr{}
  741. \def \volno{}
  742. \def \vol #1,#2.{\gdef\volno{#1\unskip}%
  743.         \gdef\issno{\ignorespaces#2\unskip}%
  744.         \setbox\TestBox=\hbox{\volyr}%
  745.         \ifdim \wd\TestBox > .2em \v@lx \fi }
  746.  
  747. \def \issdate #1#2 #3.{\gdef\issdt{#1#2 #3}\gdef\volyr{#3}%
  748.         \gdef\bigissdt{#1{\smc\uppercase{#2}} #3}%
  749.         \setbox\TestBox=\hbox{\volno}%
  750.         \ifdim \wd\TestBox > .2em \v@lx \fi }
  751.  
  752.  
  753. %       TUGboat conventions include the issue number in the file name.
  754. %       Permit this to be incorporated into file names automatically.
  755. %       If issue number = 11, \Input filnam  will read tb11filnam.tex.
  756.  
  757. \newcount\issueseqno            \issueseqno=-1
  758.  
  759. \def \Input #1 {\ifnum\issueseqno<0 \def\infil@{#1}%
  760.                 \else \def\infil@{tb\number\issueseqno#1}\fi
  761.                 \input \infil@ }
  762.  
  763.  
  764. %       Write out (both to a file and to the log) the starting page number
  765. %       of an article, to be used for cross references and in contents.
  766. %       \pagexref  is used for articles fully processed in the TUGboat run.
  767. %       \PageXref  is used for "extra" pages, where an item is submitted
  768. %               as camera copy, and only running heads (at most) are run.
  769. \def \pagexref#1{\ifFirstPar \nobreak \fi  % don't clobber switch by accident
  770.         \write-1{\def\expandafter\noexpand\csname#1\endcsname{\number\pageno}}%
  771.         \write1{\def\expandafter\noexpand\csname#1\endcsname{\number\pageno}}%
  772.         \ifFirstPar \nobreak \fi }      % and don't allow page break
  773. \def \PageXref#1{%
  774.         \immediate\write-1{\def\expandafter
  775.                         \noexpand\csname#1\endcsname{\number\pageno}}%
  776.         \immediate\write1{\def\expandafter
  777.                         \noexpand\csname#1\endcsname{\number\pageno}}}
  778.  
  779.  
  780. %       Section titles and separators
  781.  
  782. \newskip\Tabskss
  783. \Tabskss=0pt plus 1000pt minus 1000pt
  784. \newskip\AboveTitleSkip  \AboveTitleSkip=12pt   % 10pt plus 2pt minus 2pt
  785. \newskip\BelowTitleSkip  \BelowTitleSkip=8pt    % plus 1pt minus 1pt
  786.  
  787. \setbox\T@stBox=\hbox{\titlefont O}
  788. \newdimen\stfontheight          \stfontheight=\ht\T@stBox
  789. \newdimen\strulethickness       \strulethickness=.6pt
  790. \newcount\n@stnum               \n@stnum=0
  791. \def \sthrule{\hrule height\strulethickness depth 0pt }
  792. \def \stvrule{\vrule height 2\stfontheight depth\stfontheight
  793.                         width\strulethickness }
  794. \def \sectitlebox #1<{\vbox{\sthrule
  795.         \hbox to \hsize{\stvrule\hfil #1\hfil\vrule width\strulethickness }%
  796.         \sthrule }}
  797.  
  798. \def \secsep{\vskip 5\baselineskip}
  799.  
  800. \newif\ifSecTitle
  801. \SecTitlefalse
  802. %\def \sectitle #1<{\par \SecTitletrue
  803. %       \penalty-1000\secsep
  804. %       \centerline{\sectitlebox \titlefont #1<}%
  805. %       \nobreak \vskip\baselineskip }
  806.  
  807. \def \sectitle #1<{\par \SecTitletrue
  808.         \penalty-1000\secsep
  809.         \n@stnum=0
  810.         {\def\\{ }\setbox\T@stBox=\hbox{\titlefont#1}%
  811.         \ifdim\wd\T@stBox < \hsize \def\result{\unhbox\T@stBox}%
  812.         \else \def\\{\cr\noalign{\global\advance\n@stnum by 1 }}%
  813.                 \setbox\T@stBox=\vbox{\titlefont
  814.                         \halign{\hfil##\hfil\cr#1\crcr}}%
  815.                 \def\result{\vbox{\unvbox\T@stBox}}\fi
  816.         \ifnum\n@stnum=1 \def\stvrule{\vrule height 3.5\stfontheight
  817.                         depth\stfontheight width\strulethickness }\fi
  818.         \centerline{\sectitlebox \titlefont\result<}}%
  819.         \nobreak \vskip\baselineskip }
  820.  
  821. %\def \secsep{\vskip\baselineskip       %  * * *  as for TUGboat pre 5#2
  822. %       \centerline{\hbox to 180pt{%
  823. %               \leaders\hbox to 15pt{\hfil\char'052\hfil}\hfill}}%
  824. %       \vskip2\baselineskip }
  825.  
  826. \def \littlesep{\vskip 3pt plus 1pt minus 1pt
  827.         \centerline{\hbox to 90pt{\ignorespaces
  828.                 \leaders\hbox to 10pt{\hfil .\hfil}\hfill} }%
  829.         \vskip 3pt plus 1pt minus 1pt}
  830.  
  831.  
  832. %       Titles, authors, subtitles, and first-paragraph formatting
  833.  
  834. \newif\ifFirstPar       \FirstParfalse
  835. \def\SetupFirstPar{\global\parindent=0pt \global\FirstPartrue }
  836.  
  837. %               make the first paragraph after a title start flush left,
  838. %               then reset \parindent; but if all paragraphs should start
  839. %               flush left, then don't reset.
  840. \everypar{\ifNoParIndent
  841.         \else \ifFirstPar \NormalParIndent \global\FirstParfalse \fi
  842.         \fi }
  843.  
  844. %       For uppercasing title and author; from AMSPPT.STY, version 0
  845.  
  846. \def\uctext@#1{\uppercase@#1\gdef\uppercase@@{}$\m@th$}
  847. \def\uppercase@#1$#2${\gdef\uppercase@@{\uppercase@}\uppercase
  848.     {#1}${#2}$\uppercase@@}
  849.  
  850.  
  851. \newif\ifCtrTitle       \CtrTitlefalse
  852. \def \TitleUC{}                 % ordinary titles uc/lc
  853. \def \titleframe #1#2#3{\ifSecTitle \SecTitlefalse
  854.         \else \vskip\AboveTitleSkip \fi
  855.         \ifCtrTitle \def\CTSkip{\unskip\hfil}\CtrTitlefalse
  856.         \else \def\CTSkip{}\fi
  857.         \vbox{#1\halign{\hbox to \hsize
  858.                 {\bf\TitleUC{\CTSkip\ignorespaces##\unskip\hfil}}\strutt\cr
  859.                         #2\crcr}}%
  860.         \let\oldcr=\cr\def\cr{}%
  861.         \setbox\T@stBox=\hbox{#3}%
  862.         \let\cr=\oldcr
  863.         \ifdim \wd\T@stBox < 5pt                % omit if author is null
  864.         \else \nobreak \vskip 4pt       % 4pt + \BelowTitleSkip = \baselineskip
  865.                 \vbox{\halign{\hbox to \hsize
  866.                         {\hskip\parindent\CTSkip\ignorespaces##\hfil}\cr
  867.                                 #3\crcr}}\fi
  868.         \setbox\T@stBox=\hbox{}%
  869.         \nobreak \vskip\BelowTitleSkip \SetupFirstPar }
  870.  
  871. \def \title #1\\#2\endx{\titleframe{}{#1}{#2}}
  872. \def \Title #1\\#2\endx{\titleframe{\def\TitleUC{\uctext@}}{#1}{#2}}
  873.  
  874. \def \ctrtitle #1\\#2\endx{\CtrTitletrue\titleframe{}{#1}{#2}}
  875. \def \ctrTitle #1\\#2\endx{\CtrTitletrue
  876.         \titleframe{\def\TitleUC{\uctext@}}{#1}{#2}}
  877.  
  878. %       \subtitle and \subsubtitle are used in the announcements box
  879.  
  880. \def \subtitle #1\endx{{\CtrTitletrue           % \AboveTitleSkip=10pt
  881.         \titleframe{}{#1}{}}}
  882.  
  883. \def \subsubtitle #1\endx{{\CtrTitletrue
  884.         \ifFirstPar \AboveTitleSkip=0pt \fi     % \else \AboveTitleSkip=10pt
  885.         \titleframe{}{\sl#1}{}}}
  886.  
  887. %       \section  was first defined for Jacques Desarmenien's article in 5#2
  888. \def \section #1 #2\par{\ifFirstPar \nobreak
  889.         \else \penalty-200 \vskip 8pt \fi
  890.         \noindent{\bf\hbox to \normalparindent{#1\hfil}#2}\endgraf
  891.         \nobreak \vskip 4pt \SetupFirstPar }
  892.  
  893. %       This is based on \beginsection in PLAIN and \section above.
  894. \outer\def\beginsection#1\par{\ifFirstPar \nobreak
  895.         \else \vskip\z@ plus 4\baselineskip \penalty-100
  896.                 \vskip\z@ plus-4\baselineskip \vskip 8pt \vskip\parskip \fi
  897.         \message{#1}{\raggedright\noindent\bf#1\endgraf}\nobreak \vskip 4pt
  898.         \SetupFirstPar }
  899.  
  900.  
  901. %       Define address blocks and other structures that use \obeylines
  902. %       in the context  \tag ...<
  903. %       This requires that < be active, so that \obeylines is invoked
  904. %       at the outer level.  \tag{...} will not deliver the data with
  905. %       ^M (carriage return) intact, so is not a suitable format for
  906. %       any construction using \obeylines; the reference (if any) in
  907. %       The TeXbook has not been found, and this information has been
  908. %       determined empirically, referring to \obeylines constructions
  909. %       in PLAIN and MANMAC.TeX (The TeXbook macros).
  910. {\catcode`\^^M=\active % these lines must end with %
  911.   \gdef\obeylinesblock{\catcode`\^^M\active \let^^M\par\nobreak}}
  912.  
  913. {\catcode`\<=\active \obeylines
  914. \gdef\AddrFrame#1#2{\endgraf\def\Phone{\leavevmode\kern\parindent}%
  915.     \let\NetAddr=\Phone %
  916.         \catcode`\<=\active %
  917. %               next line intentionally ends with <cr> %
  918.         \def<{
  919.               \egroup\allowbreak\catcode`\<=12 #2 }\bgroup #1\obeylinesblock }%
  920. \gdef\LetterAddr{\AddrFrame{\penalty9999\smallskip}{}}%
  921. \gdef\TextAddr{\AddrFrame{\penalty9999}{}}%
  922. \gdef\Submitted{\AddrFrame{\nobreak\smallskip \parindent=1.5\normalparindent %
  923.                 \def\Signed{\parfillskip=\normalparindent \qquad\hfil }}{}}%
  924. \gdef\Columnist{\AddrFrame{\nobreak\FirstParfalse %
  925.                 \def\NetAddr{\smallskip \indent\indent }%
  926.                 \def\Phone{\NetAddr }}%
  927.     {\nobreak \vskip\BelowTitleSkip \SetupFirstPar }\sl }%
  928. }
  929.  
  930.  
  931. %       Support verbatim listing of TeX source, as defined in TeXbook, p. 421;
  932. %       lifted from MANMAC.TEX, and modified slightly for narrower columns.
  933. %
  934. %    Although | is ordinarily an escape character within verbatim mode,
  935. %    provide a method for letting it instead be the character itself
  936. %    within a display verbatim listing, as needed; this is based on
  937. %    a technique developed by Michael Ferguson.  Note that within one
  938. %    \begintt...\endtt block, | can be only one of:
  939. %        the printing | character, or
  940. %        active (the escape character)
  941. %    It cannot perform both functions at the same time.
  942.  
  943. \def\ttverbatim{\begingroup \catcode`\\=\other
  944.   \catcode`\{=\other \catcode`\}=\other \catcode`\$=\other
  945.   \catcode`\&=\other \catcode`\#=\other \catcode`\%=\other
  946.   \catcode`\~=\other \catcode`\_=\other \catcode`\^=\other
  947.   \catcode`\"=\other
  948.   \obeyspaces \obeylines \hyphenpenalty=10000 \tt}
  949.  
  950. \newskip\ttglue
  951. {\tenpoint\tt \global\ttglue=.5em plus .25em minus .15em}
  952. % this should be installed in each font
  953.  
  954. %       From David Eppstein's ``Trees'' paper (6#1), preserve initial spaces.
  955. {\obeyspaces\gdef {\ifvmode\indent\fi\space}}
  956.  
  957. \newdimen\ttrightskip
  958. \ttrightskip=5pc
  959.  
  960. \newif\ifttVertChar    \ttVertCharfalse
  961. {\catcode`\|=\active \gdef\VertChar{\def|{\char"7C }}}
  962.  
  963. \outer\def\begintt{$$\def\par{\leavevmode\null\endgraf}\ttverbatim \parskip=\z@
  964.   \ifttVertChar \VertChar \global\ttVertCharfalse \else \catcode`\|=0 \fi
  965.   \frenchspacing \rightskip=-\ttrightskip \ttfinish}
  966. {\catcode`\|=0 |catcode`|\=\other % | is temporary escape character
  967.   |obeylines % end of line is active
  968.   |gdef|ttfinish#1^^M#2\endtt{#1|vbox{#2}|endgroup$$}}
  969.  
  970. %       Other non-tt elements that may be embedded within \begintt...\endtt .
  971. \def\MTH{$}
  972. \def\sb{_}
  973. \def\sp{^}
  974. \def\SP{{\tt\char"20 }}        % "visible" space
  975. \chardef\bs=`\\
  976. \def\vrt{{\tt\char`\|}}
  977.  
  978. \catcode`\|=\active
  979. %{\obeylines \gdef|{\ttverbatim \spaceskip\ttglue \let^^M=\  \let|=\endgroup}}
  980. {\obeylines \gdef\activatettbar{\global\catcode`\|=\active %
  981.   \gdef|{\ttverbatim \spaceskip\ttglue \xspaceskip\ttglue %
  982.          \let^^M=\  \let|=\endgroup}}}
  983. \activatettbar
  984.  
  985. %    The active | (which here implements verbatim mode) is redefined in
  986. %    such headers as TABLES.TeX and must be able to be reinstated.
  987. %    \activatettbar has been tested with TABLES.TeX, and the two uses
  988. %    are mutually operable (TUGboat 7#2, "Tables in INRSTeX").
  989.  
  990. %       Define a structure that will permit a list (using \obeylines)
  991. %       to be made into 2 columns, split by \vsplit, indented the
  992. %       normal \parindent
  993.  
  994. \def \NormalizeBlockHeight{\TestCount=1                         % \@ne
  995.         \TestDimen=\dimen0 \advance\TestDimen by-\topskip
  996.         \CutOneLine }
  997. \def \CutOneLine{\advance\TestCount by 1 \advance\TestDimen by-\baselineskip
  998.         \ifdim\TestDimen < \baselineskip                        % \@ne
  999.                 \def\result{\TestDimen=\baselineskip
  1000.                         \multiply\TestDimen by \TestCount
  1001.                         \advance\TestDimen by \topskip
  1002.                         \global\dimen0=\TestDimen }%
  1003.         \else \def\result{\CutOneLine }\fi \result }
  1004.  
  1005. \def \twosplit{{\topskip=\baselineskip \splittopskip=\topskip
  1006.         \setbox0=\copy\TestBox
  1007.         \dimen0=\ht\TestBox
  1008.         \NormalizeBlockHeight
  1009.         \divide\dimen0 by 2
  1010.         \setbox\LeftHalf=\vsplit\TestBox to \dimen0
  1011.         \ifdim\ht\TestBox > \ht\LeftHalf
  1012.                 \advance\dimen0 by \baselineskip
  1013.                 \setbox\TestBox=\copy0
  1014.                 \setbox\LeftHalf=\vsplit\TestBox to \dimen0
  1015.         \fi
  1016.         \line{\kern\parindent\valign{##\vfil\cr
  1017.                 \unvbox\LeftHalf\cr\noalign{\hfil}\unvbox\TestBox\cr}}}%
  1018.         \global\setbox0=\null}
  1019.  
  1020. \newbox\LeftHalf
  1021. \newdimen\HalfWd
  1022. \HalfWd=\twocolcolwd
  1023. \advance\HalfWd by-\normalparindent
  1024. \divide\HalfWd by 2
  1025.  
  1026. {\obeylines
  1027. \gdef\twouplist #1{\topskip=\baselineskip \splittopskip=\topskip %
  1028.         \begingroup \parindent=0pt \obeylines
  1029. %                       next line ends with intentional <cr>
  1030.         \def\endtwouplist{
  1031.                         \egroup %               % end of \vbox
  1032.                         \endgroup %             % end of \obeylines group
  1033.                         \twosplit }%
  1034.         \global\setbox\TestBox=\vbox\bgroup\hsize=\HalfWd %
  1035.                 \indent\vrule height\topskip width 0pt #1}%
  1036. }
  1037.  
  1038.  
  1039. %       Tags for special formatting of editor's notes, meeting
  1040. %       attendees lists, etc.
  1041.  
  1042. \def \Editor{\noindent To the Editor:\par}
  1043. \def \xEdNote{{\tenupit Editor's note:\enspace }}
  1044. \def \EdNote #1{\if #1[\unskip\hskip1em [\thinspace\xEdNote\ignorespaces
  1045.         \else \ifFirstPar \else \medskip\noindent \fi
  1046.                 \xEdNote #1\fi }
  1047.  
  1048. \def \Attendee #1 {\par \noindent\hangindent 2\normalparindent
  1049.         \hbox to .5\normalparindent{\hfil #1\thinspace}\ignorespaces}
  1050.  
  1051. \def \Dag{\raise .6ex\hbox{$\scriptstyle\dagger$}}
  1052.  
  1053.  
  1054. %       Footnotes are mainly supported by PLAIN format, with these
  1055. %       exceptions.
  1056.  
  1057. \skip\footins=12pt              % full blank line       % 24pt
  1058. \def\footnoterule{\kern-8pt
  1059.         \hrule width 5pc \kern 7.6pt } % the \hrule is .4pt high
  1060.  
  1061. \newif\ifDelayFirstPar        \DelayFirstParfalse
  1062. \def\vfootnote#1{\ifFirstPar \DelayFirstPartrue \fi
  1063.   \insert\footins\bgroup
  1064.   \interlinepenalty\interfootnotelinepenalty
  1065.   \splittopskip\ht\strutbox % top baseline for broken footnotes
  1066.   \splitmaxdepth\dp\strutbox \floatingpenalty\@MM
  1067.   \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip
  1068.   \parindent=\normalparindent % always indent footnotes; added for TUGboat
  1069.   \textindent{#1}\footstrut\futurelet\next\fo@t}
  1070. \def\@foot{\strut\egroup
  1071.     \ifDelayFirstPar \SetupFirstPar    \global\DelayFirstParfalse \fi }
  1072.  
  1073.  
  1074. %       Draw a box around a whole page, e.g. announcements page;
  1075. %       format must be \onenarrow or \onemedium, and start on a new page.
  1076.  
  1077. \def \bigbox{\hrule \hbox\bgroup \vrule\kern 1pc
  1078.         \vbox\bgroup \vskip 1pc }
  1079. \def \endbox{\endgraf \vskip 1pc \egroup \kern 1pc\vrule \egroup \hrule }
  1080.  
  1081.  
  1082. %       Macros to produce extra running heads for stripping onto pages
  1083. %       received as camera copy.  Format must be preset to \OneCol, and
  1084. %       start on a new page.
  1085.  
  1086. %       Generate 5 (4 + normal running head) per page.
  1087.  
  1088. \def \DrawT@pLines{\vskip\topskip
  1089.         \ulap{\line{\raise 1ex\rlap{\leaders\hrule\hskip\pagewd}%
  1090.                         \leaders\hrule\hfill}}\medskip}
  1091.  
  1092. \def \r@nhead{\vbox to .23\vsize{\basezero \hsize=\pagewd \vfil
  1093.         \topregister \vskip\headmargin \runhead \DrawT@pLines }\medskip
  1094.         \advancepageno }
  1095.  
  1096. \def \nextrunner{%
  1097.     \ifnum\T@stCount>0
  1098.         \ifnum\T@stCount>5 \TestCount=5 \else\TestCount=\T@stCount \fi
  1099.         \advance\T@stCount by-\TestCount
  1100.         \DrawT@pLines        % always one at top of page
  1101.         \loop\ifnum\TestCount>1 \r@nhead \advance\TestCount by\m@ne
  1102.             \repeat \newpage
  1103.         \nextrunner
  1104.     \fi }
  1105.  
  1106. \def \ExtraRunheads #1, #2.{\T@stCount=#1
  1107.         \gdef\pageprefix{#2}%   % as in A-10 for appendices; not used just now
  1108.     \nextrunner }
  1109.  
  1110.  
  1111. \catcode`\@=12
  1112. %               @ is prohibited in AMS-TeX, but should not be in TUGboat
  1113.  
  1114. %       some hyphenation exceptions:
  1115. \hyphenation{man-u-script man-u-scripts}
  1116.  
  1117. \endinput
  1118.  
  1119. \tracingonline=1
  1120. \showbox255
  1121.